<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>泉城投票</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/css/vote/unregister/frozen.css">
    <link rel="stylesheet" href="/css/vote/unregister/vote.css">
    <script src="/js/admin/jquery.min.js" type="text/javascript"></script>
</head>

<body>
<div class="vote-text">
<div id="main" style="background-image:url('{{$backgroundImg or '/images/vote/unregister/wen.png'}}');">
    <div class="ui-whitespace header header_rule">
        <h1 class="center " id="vote-title"></h1>
        <div class="mt25">
            <p class="hTitle">
                投票时间:
            </p>
            <span id="vote-duration"></span>
        </div>
        <div class=" rule">
				<span class="hTitle mt10">
					投票规则:
				</span>
            <div class="mt10">
                <p id="vote-rules"></p>
            </div>

        </div>
    </div>
</div>
</div>
<script>
    //IOS中激活a标签active事件
    var a = document.getElementsByTagName('a');
    for(var i = 0; i < a.length; i++)
    {
        a[i].addEventListener('touchstart',function(){},false);
    }
    document.body.addEventListener('touchstart', function () { });

    var __vote_id = "{{ $voteId }}";
    var __uid = "{{ $uid }}";
    var __signed = "{{ $signed }}";
    var __query_string = "{!! $queryString !!}";

    $.ajax({
        url: '/lua/api/vote/details',
        data: {vote_id: __vote_id},
        type: 'get',
        dataType: 'json',
        success: function (response) {
            if (response.code == 200) {
                var vote = response.data.details;
                document.title = vote.title;
                $('#vote-title').text(vote.title);
                $('#vote-rules').html(vote.rules);
                $('#vote-duration').text(vote.duration);
//                if(vote.background_img){
//                    $('#main').css("background-image","url('"+vote.background_img+"')");
//                }
            }
        },
        error: function (error) {
            console.log(error);
        }
    });
</script>
</body>
</html>